﻿using JavaVirtualMachine.ConstantPoolItems;
using System;
using UnityEngine;
namespace JavaVirtualMachine.StackTracePrinters
{
    public class EmptyStackTracePrinter : IStackTracePrinter
    {
        public static EmptyStackTracePrinter Instance { get; } = new();

        private EmptyStackTracePrinter()
        {

        }

        public void PrintMethodCall(MethodInfo method, Span<int> args, CInterfaceMethodRefInfo? interfaceMethod = null) {
            //Debug.Log("call method:" + method.ClassFile.Name+" "+ method.Name);
        }

        public void PrintMethodReturn(MethodInfo method, int returnValue) {
           // Debug.Log("call method:" + method.ClassFile.Name + " " + method.Name);
        }

        public void PrintMethodReturn(MethodInfo method, long returnValue) {
            //Debug.Log("call method:" + method.ClassFile.Name + " " + method.Name);
        }

        public void PrintMethodReturn(MethodInfo method) {
           // Debug.Log("call method:" + method.ClassFile.Name + " " + method.Name);
        }

        public void PrintMethodThrewException(MethodInfo method, int exception) {
            Debug.LogWarning("Threw Exception:" + method.ClassFile.Name + " " + method.Name+"  "+method.Descriptor);
        }
    }
}
